﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace UwinEducation.Domain.Entities
{
    /// <summary>
    /// 权限数据
    /// </summary>
    [Table("sys_permissions")]
    public class Permission : EntityBase
    {
        public Guid Id { get; private set; }
        public string Name { get; private set; }
        public string Code { get; private set; }
        public string Description { get; private set; }
        //public ICollection<RolePermission> RolePermissions { get; private set; }

        private Permission() { }

        public static Permission Create(string name, string code, string description)
        {
            return new Permission
            {
                Id = Guid.NewGuid(),
                Name = name,
                Code = code,
                Description = description,
                //RolePermissions = new List<RolePermission>()
            };
        }
    }
}
